////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <osgViewer/Viewer>
//#include <osg/Node>
//#include <osg/Group>
//#include <osg/Geode>
//#include <osg/Geometry>
#include <osg/ShapeDrawable>
//#include <osg/Texture2D>

////////////////////////////////////////////////////////////
/// Entry point of application
////////////////////////////////////////////////////////////
int main(int argc, char** argv){
  osgViewer::Viewer viewer; 
  osg::ref_ptr<osg::Group> root (new osg::Group);

  // Create a Geode with a ogs Capsule Shape Drawable
  osg::ref_ptr<osg::Geode> myShapeGeode (new osg::Geode);
  // Generated shape
  osg::ref_ptr<osg::Capsule> myCapsule (new osg::Capsule(osg::Vec3f(), 1, 2)); // My shape
  osg::ref_ptr<osg::ShapeDrawable> myCapsuleDrawable (new osg::ShapeDrawable(myCapsule.get())); // My shape drawable
  // Set the Drawable content to the Geodes
  myShapeGeode->addDrawable(myCapsuleDrawable.get()); 

  //// Create a Geode with a ogs geometry
  //osg::ref_ptr<osg::Geode> myGeometryGeode (new osg::Geode);
  //// Generate geometry
  //osg::ref_ptr<osg::Geometry> myGeometry (new osg::Geometry);
  //// Declare vertices
  //osg::ref_ptr<osg::Vec3Array> myGeometryVertices (new osg::Vec3Array);
  //myGeometryVertices->push_back( osg::Vec3( 2, 0, 0)); // front left
  //myGeometryVertices->push_back( osg::Vec3(10, 0, 0)); // front right
  //myGeometryVertices->push_back( osg::Vec3(10, 8, 0)); // back right 
  //myGeometryVertices->push_back( osg::Vec3( 2, 8, 0)); // back left 
  //myGeometryVertices->push_back( osg::Vec3( 4, 4, 8)); // peak
  //// Associate vertices to the Geometry
  //myGeometry->setVertexArray(myGeometryVertices.get());
  //// Define Bottom Faces
  //osg::ptr_ref<osg::DrawElementsUInt> geometryBase (new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0));
  //geometryBase->push_back(3);
  //geometryBase->push_back(2);
  //geometryBase->push_back(1);
  //geometryBase->push_back(0);
  //// Associate face to the Geometry
  //myGeometry->addPrimitiveSet(geometryBase.get());


  // Set the Drawable content to the Geodes
  //myGeometryGeode->addDrawable(myGeometry.get());


  // Add Geodes to the scene
  root->addChild(myShapeGeode.get());
  //root->addChild(myGeometryGeode.get());
  // Attach the scene to the viewer
  viewer.setSceneData(root.get()); 

  return (viewer.run()); // Main loop 
}

